package com.ssm.controller;

import com.common.user.User;
import com.core.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/login")
    public String login(User user){
        System.out.println(user.getName());
        if(userService.login(user)){
            return "redirect:/success.html";
        }else{
            return "redirect:/index.jsp";
        }
    }
}
